<template>
	<view class="one">
		<p class="xia">下单日期</p>
		<view class="box flex">
			<picker mode="date" fields="month" :value="date" @change="bindDateChange" class="picker">
				<view class="uni-input">{{date}}</view>
			</picker>
			<picker mode="date" fields="month" :value="date" @change="bindDateChange1" class="picker">
				<view class="uni-input">{{date1}}</view>
			</picker>
		</view>
		<view class="bottom ">
			<view class="foot flex">
				<view class="but1">
					<button>重置</button>
				</view>
				<view class="but2">
					<button>确定</button>
				</view>
			</view>


		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				date: "起始日期",
				date1: "终止日期"
			}
		},
		methods: {
			bindDateChange: function(e) {
				this.date = e.target.value
				console.log(this.date)
			},
			bindDateChange1: function(e) {
				this.date1 = e.target.value
				console.log(this.date1)
			},
			getCurrentMonth() {
				const date = new Date()
				let year = date.getFullYear()
				let month = date.getMonth() + 1
				month = month > 9 ? month : '0' + month
				return `${year}-${month}`
			}
		}
	}
</script>

<style>
	.flex {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.xia {
		width: 90%;
		margin: 0 auto;
		padding: 20rpx;
	}

	.box {
		width: 90%;
		margin: 0 auto;
		padding: 20rpx;
		background-color: #fff;
		border-radius:20rpx;
	}

	.picker {
		width: 45%;
		height: 50px;
		line-height: 50px;
		text-align: center;
	}

	.picker:first-child {
		border-right: #ccc 1px solid;
	}

	.bottom {
		background-color: #fff;
		position: absolute;
		bottom: 0;
		width: 100%;
	}
.foot{width:90%;margin:0 auto;padding:20rpx;}
	.but1 {
		border: #ccc 1px solid;
		width: 45%;
	}

	.but2 {
		width: 45%;
	}

	.but1 button {
		background-color: #fff;
	}

	.but2 button {
		background-color: #f00;
	}
</style>
